package com.wintor.server;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

import com.wintor.client.WintorEvolutionService;
import com.wintor.shared.FieldVerifier;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
public class WintorEvolutionScheduler extends HttpServlet {
	
	public void service(ServletRequest request, ServletResponse response)
			throws ServletException, IOException {		
		WintorEvolution wintorEvolution = new WintorEvolution(); 		
		Wintor wintor = wintorEvolution.startTrackOnce();
		
		response.setContentType("text/html");
		PrintWriter pw = response.getWriter();
		pw.println("<html>" +
				      "<head></head>" +
				      "<body>" +
				        "<title>Wintor Evolution Scheduler</title> " +
				        "<p>" + 
				        "Recorded Successfully: (" + wintor.toString() + ")." + 
				        "</p> " +
				        "<p> " +
				          "<a href=\"http://www.google.com/fusiontables/DataSource?dsrcid=671581\" target=\"result\">Check the result >> " + "</a> " +
				        "</p>" +
				      "</body>" +
				    "</html>");
		pw.close();

	}

}
